<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<c:set var="grant_code"><x:out select="$xmlData/data/proposal/grant_code" /></c:set>
<c:set var="sub_grant_code"><x:out select="$xmlData/data/proposal/sub_grant_code" /></c:set>

<div class="t_bar">项目预算经费（单位：万元）</div>
<table class="table01 t_css" width="100%" border="0" cellpadding="0" id="tblfunds"
	cellspacing="1">
	<tr>
	    <td width="200px" align="left">1.总投资</td>
		<td colspan="3">
			<input id="invest_total" name="budget/invest_detail/total" label="总投资" type="text" disabled
					class="input_text gray"  style="text-align:right" maxlength="50" onfocus="InitInput.setNumber(this,7,4,2)"
					value="<x:out select="$xmlData/data/budget/invest_detail/total" />" /> （由系统自动合计第2项“已筹集资金”和第3项“尚欠缺经费”）
		</td>
	</tr>
	<tr>
	    <td rowspan="2"><span class="color_red">*</span>2.已筹集资金</td>
	    <td>单位自出</td>
	    <td colspan="2">
			<input id="invest_finish_seft" name="budget/invest_detail/finish_seft" label="已筹集资金中单位自出" type="text"
					class="input_text required maxlength:20"  style="text-align:right;width:200px;" maxlength="50" onfocus="InitInput.setNumber(this,7,4,2)"
					value="<x:out select="$xmlData/data/budget/invest_detail/finish_seft" />" 
					onchange="countFundAuto('invest_','finish_seft,finish_country,need_seft,need_country,need_amt','total')" /> 
		</td>
	</tr>
	<tr class="li_2">
	   <td>其他资金</td>
	   <td colspan="2">
			<input id="invest_finish_country" name="budget/invest_detail/finish_country" label="已筹集资金中其他资金" type="text"
					class="input_text required maxlength:20"  style="text-align:right;width:200px;" maxlength="50" onfocus="InitInput.setNumber(this,7,4,2)"
					value="<x:out select="$xmlData/data/budget/invest_detail/finish_country" />" 
					onchange="countFundAuto('invest_','finish_seft,finish_country,need_seft,need_country,need_amt','total')" /> 
		</td>
	</tr>
	<tr>
	   <td rowspan="3"><span class="color_red">*</span>3.尚欠缺经费</td>
	   <td>单位自筹</td>
	   <td colspan="2">
			<input id="invest_need_seft" name="budget/invest_detail/need_seft" label="尚欠缺经费中单位自筹" type="text"
					class="input_text required maxlength:20"  style="text-align:right;width:200px;" maxlength="50" onfocus="InitInput.setNumber(this,7,4,2)"
					value="<x:out select="$xmlData/data/budget/invest_detail/need_seft" />" 
					onchange="countFundAuto('invest_','finish_seft,finish_country,need_seft,need_country,need_amt','total')" /> 
	    </td>
	</tr>
	<tr class="li_2">
	   <td>申请区项目资金</td>
	   <td colspan="2">
			<input id="invest_need_country" name="budget/invest_detail/need_country" label="尚欠缺经费中申请区项目资金" type="text"
					class="input_text required maxlength:20"  style="text-align:right;width:200px;" maxlength="50" onfocus="InitInput.setNumber(this,7,4,2)"
					value="<x:out select="$xmlData/data/budget/invest_detail/need_country" />" 
					onchange="countFundAuto('invest_','finish_seft,finish_country,need_seft,need_country,need_amt','total')" /> 
	    </td>
	</tr>
</table>
<br>
<br>
<input
		type="hidden" name="budgets/financialplans_total" id="financialplans_total" class="gray"
		disabled label="申请资助资金总额" style="text-align: right; width: 100px;"
		value="<x:out select="$xmlData/data/budgets/financialplans_total" />" />
		
<div class="t_bar"><span class="color_red">*</span>申请区项目资金用途</div>
<table class="table01" width="100%" border="0" cellpadding="0"
	id="tblfinancialplans" cellspacing="1">
    <thead>
		<tr>
			<th class="TblHead" align="center" width="5%">选择</th>
			<th class="TblHead" align="center" width="5%">序号</th>
			<th class="TblHead" align="center" width="30%">费用类别</th>
			<th class="TblHead" align="center" width="20%">金额（万元） </th>
			<th class="TblHead" align="center" width="40%">具体用途 </th>
		</tr>
			</thead>
			<tbody id="tab">
					<tr style="display:none">
						<td style="text-align:center;">&nbsp;
							<input type="radio" class="radiobutton" name="selfinancialplans" >
						</td>
						<td style="text-align:center;">&nbsp;
							<span name="financialplans|financialplan[0]@seq_no" >[index]</span> 
						</td>
						<td >
							<input type="text" size="45"  name="financialplans|financialplan[0]|category" class="input_text required talflag" maxlength=50 label="费用类别" value="" />&nbsp;
						</td>
						<td >
							<input type="text" size="27"  name="financialplans|financialplan[0]|money" class="input_text required talflag"  style="text-align:right;"
							label="使用金额" value="" onchange="countTable('tblfinancialplans','financialplans_total','3')" onfocus="InitInput.setNumber(this,7,4,2)" />&nbsp;
						</td>
						<td >
							<input type="text" size="60"  name="financialplans|financialplan[0]|use" class="input_text required talflag" maxlength=50 label="具体用途" value="" />&nbsp;
						</td>
					</tr>
					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/financialplans/financialplan" var="financialplan">
					<c:choose>
						<c:when test="${index<10}" >
						<c:set value="0" var="flag" scope="page"/>
						</c:when>
						<c:otherwise>
						<c:set value="" var="flag" scope="page"/>
						</c:otherwise>
					</c:choose>
					<tr>
						<td style="text-align:center;">&nbsp;
							<input type="radio" class="radiobutton" name="selfinancialplans" >
						</td>
						<td style="text-align:center;">
							<span name="financialplans/financialplan[${flag}${index}]@seq_no" >${index+1}</span> 
						</td>
						<td >
							<input type="text"  name="financialplans/financialplan[${flag}${index}]/category" 
							class="input_text required talflag"  label="费用类别" size="45" 
							value="<x:out select="$financialplan/category" /> "/>&nbsp;
						</td>
						<td >
							<input type="text"  name="financialplans/financialplan[${flag}${index}]/money" 
							class="input_text required talflag" maxlength=50 label="金额" size="27" style="text-align:right;"
							onfocus="InitInput.setNumber(this,7,4,2)"
							onchange="countTable('tblfinancialplans','financialplans_total','3')"
							value="<x:out select="$financialplan/money" />" />&nbsp;
						</td>
						<td >
							<input type="text"  name="financialplans/financialplan[${flag}${index}]/use" 
							class="input_text required talflag" maxlength=50 label="具体用途"  size="60" 
							value="<x:out select="$financialplan/use" />" />&nbsp;
						</td>
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
				</tbody>
			</table>
			<table width="98%" align="center">
				<tr>
					<td>
					
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblfinancialplans',10,'只能填写10个申请区项目资金用途')){addNewRow('tblfinancialplans');}try{top.resizeFrame();}catch(e){};">
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblfinancialplans','selfinancialplans')">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblfinancialplans','selfinancialplans')">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblfinancialplans','申请区项目资金用途');countTable('tblfinancialplans','financialplans_total','3');">
					</td>
				</tr>
	        </table>
